package cn.com.cetccst.deviceoperation;

import android.util.Log;

import cn.com.cetccst.datacenter.policy.entity.PolicyEntity;

public enum OperatorType {
    SHUTDOWN(PolicyEntity.PARSER_OP_SHUTDOWN),
    RESTART(PolicyEntity.PARSER_OP_RESTART),
    RESET(PolicyEntity.PARSER_OP_WIPE_DEVICE),
    UNREGISTER(PolicyEntity.PARSER_OP_UNENROLL),
    LOCK_DEVICE(PolicyEntity.PARSER_OP_LOCK_DEVICE),
    UNLOCK_DEVICE(PolicyEntity.PARSER_OP_UNLOCK_DEVICE);

    public String cmd;

    OperatorType(String cmd) {
        this.cmd = cmd;
    }

    @Override
    public String toString() {
        return cmd;
    }

    public static OperatorType lookUp(String cmd) {
        for (OperatorType op : OperatorType.values()) {
            if (cmd.equals(op.cmd)) {
                return op;
            }
        }
        Log.w("OperatorType", "not define name " + cmd);
        return null;
    }
}
